<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;

class SuggestController extends Controller
{
    //建议列表
    public function suggest_lists(){
    	$suggest = Db::table('suggest')->orderBy('id','desc')->paginate(15);

    	foreach ($suggest as $key => $value) {
            if(!empty($value->image)){
                $value->image = Storage::url($value->image);
            }

            $value->time = date('Y-m-d h:i:s',$value->time);
        }

    	return view('suggest_lists',['suggest'=>$suggest]);
    }
}
